Link to this headingGimli
Link to this headingImplementation
#Do rounds backwards since the round number is par of the constant
#For Each Column Do the Block info
#Get shifted Temp variables
=
=
=
#Do Operation and store the data
= ^ ^
= ^ ^
= ^ ^
#Swap values 0<->1 and 2<->3
, = ,
, = ,
#Add constant to deified by round number
^=
#Swap values 0<->2 and 1<->3
, = ,
, = ,
return
= 12
= 16
=
#Calculate the index for the padding
=
= //
= %
= 0x1F <<
#XOR the correct data
^=
#Add Second bit of padding to the beginning of the 4th 32-bit integer
^= 0x80000000
= 0
#Calculate the index of the 32-bit int array
= //
#When a full block is done call gimli algorithm
=
#Update Blocks in correct endian to the first 4 state blocks only
^=
#Finalize Message with constants and padding info
#Squeeze Blocks
= b
= 0
=
#Output Data
#Call Gimli
#gimli is also called before any output data is copyed
#This call was usually in the finalize block but made more sense here
=
= 0
#Copy 32bit integer to output
+=
#Update loop variables
+=1
-= 4
return
return
#Gimli Test Vector
=
=
=
#ba11c85a91bad119380ce880d24c2c683eceffea277a921c4f73a0bdda5a9cd884b673f034e52ff79e2bef49f41bb8d6
#ba11c85a91bad119380ce880d24c2c683eceffea277a921c4f73a0bdda5a9cd884b673f034e52ff79e2bef49f41bb8d6
#Gimli Hash Test Vectors
=
=
=
=
= b
=
#4afb3ff784c7ad6943d49cf5da79facfa7c4434e1ce44f5dd4b28f91a84d22c8
#4afb3ff784c7ad6943d49cf5da79facfa7c4434e1ce44f5dd4b28f91a84d22c8
=
#ba82a16a7b224c15bed8e8bdc88903a4006bc7beda78297d96029203ef08e07c
#ba82a16a7b224c15bed8e8bdc88903a4006bc7beda78297d96029203ef08e07c
=
#8dd4d132059b72f8e8493f9afb86c6d86263e7439fc64cbb361fcbccf8b01267
#8dd4d132059b72f8e8493f9afb86c6d86263e7439fc64cbb361fcbccf8b01267
=
#8887a5367d961d6734ee1a0d4aee09caca7fd6b606096ff69d8ce7b9a496cd2f
#8887a5367d961d6734ee1a0d4aee09caca7fd6b606096ff69d8ce7b9a496cd2f
=
#b0634b2c0b082aedc5c0a2fe4ee3adcfc989ec05de6f00addb04b3aaac271f67
#b0634b2c0b082aedc5c0a2fe4ee3adcfc989ec05de6f00addb04b3aaac271f67